package com.ys.code.generator.core.jdbc;

import java.util.HashMap;
import java.util.Map;

import com.ys.code.generator.core.vo.BaseInfo;

public class FileList {
	public static Map<String, String> getFileToPath(BaseInfo baseInfo) {
		Map<String,String> fileToPath = new HashMap<String,String>();
		
		String model=baseInfo.getModel();
		String objectName=baseInfo.getObjectName(); 
		String abbObjectName=baseInfo.getAbbObjectName();
		String companyName=baseInfo.getCompanyName();
		Map<String, String> templates = baseInfo.getTemplates();
		
		fileToPath.put("/dao/mapper/mapper.ftl", "com/" + companyName + "/model/" + model + "/xml/" + objectName + ".xml");
		fileToPath.put("/domain/domain.ftl", "com/" + companyName + "/model/" + model + "/" + objectName + ".java");
		fileToPath.put("/domain/basemodel.ftl", "com/" + companyName + "/model/BaseModel.java");
		fileToPath.put("/ys/dao/dao.ftl", "com/" + companyName + "/dao/" + model + "/" + "I" + objectName + "Dao" + ".java");
		fileToPath.put("/ys/dao/impl/daoimpl.ftl", "com/" + companyName + "/dao/" + model + "/impl/" + objectName + "DaoImpl" + ".java");
		fileToPath.put("/ys/service/service.ftl", "com/" + companyName + "/service/" + model + "/" + "I" + objectName + "Service" + ".java");
		fileToPath.put("/ys/service/impl/serviceimpl.ftl", "com/" + companyName + "/service/" + model + "/impl/" + objectName + "ServiceImpl" + ".java");
		fileToPath.put("/ys/web/controller/controller.ftl", "com/" + companyName + "/web/controller/" + model + "/" + objectName + "Controller" + ".java");
		fileToPath.put("/ys/web/js/js.ftl", "com/" + companyName + "/web/js/" + model + "/" + abbObjectName + ".js");
		fileToPath.put("/ys/web/page/share/include.ftl", "com/" + companyName + "/web/page/share/include.ftl");
		fileToPath.put("/ys/web/page/share/toolbar_common.ftl", "com/" + companyName + "/web/page/share/toolbar_common.ftl");
		fileToPath.put("/ys/web/page/page_list.ftl", "com/" + companyName + "/web/page/" + model + "/" + abbObjectName + "_list.ftl");
		fileToPath.put("/ys/web/page/page_update.ftl", "com/" + companyName + "/web/page/" + model + "/" + abbObjectName + "_update.ftl");
		
		if(null!=templates){
			fileToPath.putAll(templates);
		}
		return fileToPath;
	}
}